package cn.cvs.web.exception;

import org.apache.shiro.authz.UnauthenticatedException;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpServletRequest;

@ControllerAdvice
public class GlobalExcetionHandler {
    public ModelAndView unauthorizedExceptionHandle(HttpServletRequest request, UnauthenticatedException e){
        ModelAndView mv=new ModelAndView("403");
        mv.addObject("exception",e);
        mv.addObject("url",request.getRequestURL());
        return mv;
    }

}
